<template>
  <view class="product-detail-header">
    <view class="price">
      <text v-if="price.points"
        ><text class="number">{{ price.points }}</text
        >积分</text
      >
      <text v-if="price.money"
        >￥<text class="number">{{ moneyFormat(price.money) }}</text></text
      >
      <!-- <text class="stock">月销{{ stock }}</text> -->
    </view>
    <view v-if="price.points" class="price-type">全积分</view>
    <view class="name">{{ name }}</view>
    <view class="description">{{ description }} </view>
  </view>
</template>

<script lang="ts">
import { moneyFormat } from "../../../../../services/products-service";
import "./index.less";

export default {
  props: {
    price: {
      type: Object,
      default: () => ({ money: 0, points: 0 }),
    },
    name: {
      type: String,
      default: "",
    },
    stock: {
      type: Number,
      default: 0,
    },
    description: {
      type: String,
      default: "",
    },
  },
  data() {
    return {};
  },
  methods: {
    moneyFormat,
  },
};
</script>
